﻿using System.ComponentModel.DataAnnotations;
using DevelopmentKit.Cms.Enums;
using SharpArch.Domain.DomainModel;

namespace DevelopmentKit.Cms.Domain
{
    /// <summary>
    /// 属性校验信息
    /// </summary>
    public class PropertyValid:Entity
    {

        /// <summary>
        /// 错误信息
        /// </summary>
        [Display(Name = "错误信息")]
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(32, ErrorMessage = "{0}取值长度{1}~{2}个字符", MinimumLength = 0)]
        public virtual string ErrorMessage { get; set; }
        /// <summary>
        /// 验证类型
        /// </summary>
        [Display(Name = "错误信息")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual PropertyValidType PropertyValidType { get; set; }
        /// <summary>
        /// 最大值
        /// </summary>
        [Display(Name = "最大值")]
        public virtual decimal Max { get; set; }
        /// <summary>
        /// 最小值
        /// </summary>
        [Display(Name = "最小值")]
        public virtual decimal Min { get; set; }

        /// <summary>
        /// 验证参数
        /// </summary>
        [Display(Name = "验证参数")] 
        [StringLength(32, ErrorMessage = "{0}取值长度{1}~{2}个字符", MinimumLength = 0)]
        public virtual string Value { get; set; }


        /// <summary>
        /// 归属属性
        /// </summary>
        [Display(Name = "归属属性")]
        [Required(ErrorMessage = "{0}不能为空")]
        public virtual ContentProperty ContentProperty { get; set; } 
    }
}